var projectId = null;
var projectData = null;
var planId = null;
var modelId = null;
var planData = null;
var tabs = [];
var panel = null;
var paramList = [];
var listdata = [];
var listview = null;
var planIds = [];
var pageType_ ="";
var userId = "";
var treeNodeIndex = 0;
function initPage(pageType) {
	if(sessionStorage.getItem("pageType_")){ 
		pageType_=sessionStorage.getItem("pageType_");
	}else{
		pageType_ =pageType;
	}
	$.ajax({
		url: "../g/service/Sample/getUserId",
		type:'POST',
		cache:false,
		async:false,
		dataType: "json",
		contentType:"application/json",
        success:function(data){
        	userId = data;
        	if(data == 0 || data == 1) {
        		$("#system").show();
        	} else {
        		$("#system").hide();
        	}
        }
	});
	if(pageType_ == "route"){
		$("#btnRoute").css("background-color","white");
		$("#btnMeos").css("width","150px");
		$("#btnMeos").css("background-color","#b0b6bd");
	}
	if(pageType_ == "meos"){
		$("#btnRoute").css("background-color","#b0b6bd");
		$("#btnMeos").css("width","115px");
		$("#btnMeos").css("background-color","white");
	}
	showLoginInfo();
	var reg = new RegExp("(^|&)projectId=([^&]*)(&|$)", "i");
	var param = window.location.search.substr(1).match(reg);
	if (param != null) {
		projectId = param[2];
	} else {
		return;
	}
	
	var reg = new RegExp("(^|&)modelId=([^&]*)(&|$)", "i");
	var param = window.location.search.substr(1).match(reg);
	if (param != null) {
		modelId = param[2];
	} else {
		return;
	}
	if(modelId==9){
		$("#meostitle").text('系统规划');
	}else{
		$("#meostitle").text('运行模拟');
	}
	projectData = getProject(projectId);
	if (!projectData || projectData.error) {
		showMsgBox("获取工程失败！",function(type) {
			return true;
		});
		return;
	}
	planData = getPlanList(projectId);
	if (!planData || planData.error) {
		showMsgBox("获取方案失败！",function(type) {
			return true;
		});
		return;
	}

	treeNodeIndex = planData.length - 2;
	window.onContextMenu = onContextMenu;
	window.onmouseover = onMouseOver;
	window.onresize = onResize;

	$("#progressState").loadStep({
		size: "large",
      	color: "blue",
      	/*steps: [
      		{title: "新能源", content: "可再生能源运行模拟"},
      		{title: "水电",content: "长期水电运行模拟"},
      		{title: "检修",content: "检修运行模拟"},
      		{title: "日运行",content: "逐日运行模拟"},
      		{title: "计算结果",content: "导入计算结果"}
      	]*/
	steps: [
  		{title: "读入数据", content: "读入数据"},
  		{title: "建立约束",content: "建立约束"},
  		{title: "模型求解",content: "模型求解"},
  		{title: "计算结束",content: "计算结束"},
  		{title: "结果导入",content: "结果导入"}
  	]
    });
    $("#progressState").setStep(1);

	$('#btnPanel').click(function(){
		$("#inPlanName")[0].setValue("");
		$("#inPlanDemo")[0].setValue("");
		$('#wizardMask').show();
		$('#planPanel').show();
	});
	$('#btnAddPlan').click(function(){
		$("#inPlanName")[0].setValue("");
		$("#inPlanDemo")[0].setValue("");
		initPlanList();
		$('#wizardMask').show();
		$('#planPanel').show();
	});
	$('#btnCancel').click(function(){
		$('#wizardMask').hide();
		$('#planPanel').hide();
	});
	$('#btnCancelEdit').click(function(){
		$('#wizardMask').hide();
		$('#planPanelEdit').hide();
	});
	$('#btnCancelDele').click(function(){
		$('#wizardMask').hide();
		$('#planPanelDele').hide();
	});
	$('#btnFinish').click(function(){
		JyyLoading.start();
		$('#wizardMask').hide();
		$('#planPanel').hide();
		$("#inPlanName")[0].clearError();
		var inPlanName = $("#inPlanName")[0].getValue();
		if (RxCommon.isEmpty(inPlanName)) {
			$("#inPlanName")[0].setError("请填写方案名！");
			return;
		}
		var inPlanDemo = $("#inPlanDemo")[0].getValue();
		var inCopyPlanDemo = $('#inCopyPlanDemo').val();
		$.when(createPlan(projectData.id,modelId, inPlanName, inPlanDemo, inCopyPlanDemo)).done(function(result){
			if (!result || result.error) {
				if (result.itemName === "planName") {
					$("#inPlanName")[0].setError("方案名已经存在！");
					return;
				} else {
					showMsgBox("方案工程失败！",function(type) {
						return true;
					});
					return;
				}
			} else {
				planData = getPlanList(projectId);
				treeNodeIndex = planData.length - 2;
				loadTreeView("");
				showMsgBox("新建方案成功！",function(type) {
					return true;
				});
			}
			JyyLoading.end();
		});
	});

	$('#btnFinishEdit').click(function(){
		$("#inPlanNameEdit")[0].clearError();
		var inPlanName = $("#inPlanNameEdit")[0].getValue();
		var inPlanDemo = $("#inPlanDemoEdit")[0].getValue();
		if (RxCommon.isEmpty(inPlanName)) {
			$("#inPlanNameEdit")[0].setError("请填写方案名！");
			return;
		}
		var result = editPlan(planData.id, inPlanName, inPlanDemo);
		if (!result || result.error) {
			if (result.itemName === "planName") {
				$("#inPlanNameEdit")[0].setError("方案名已经存在！");
				return;
			} else {
				showMsgBox("修改方案工程失败！",function(type) {
					return true;
				});
				return;
			}
		} else {
			planData = getPlanList(projectId);
			loadTreeView("");
			showMsgBox("修改方案成功！",function(type) {
				return true;
			});
		}
		$('#wizardMask').hide();
		$('#planPanelEdit').hide();
	});
	
	$('#btnFinishDele').click(function(){
		JyyLoading.start();
		$('#wizardMask').hide();
		$('#planPanelDele').hide();
		$("#inPlanNameDele")[0].clearError();
		var inPlanName = $("#inPlanNameDele")[0].getValue();
		var inPlanDemo = $("#inPlanDemoDele")[0].getValue();
		if (RxCommon.isEmpty(inPlanName)) {
			$("#inPlanNameDele")[0].setError("请填写方案名！");
			return;
		}
		var inPlanDemo = $("#inPlanDemoDele")[0].getValue();
		$.when(delPlan(planData.id)).done(function(result){
			if (!result || result.error) {
				if (result.itemName === "planName") {
					$("#inPlanNameDele")[0].setError("方案名已经存在！");
					return;
				} else {
					showMsgBox("删除方案工程失败！",function(type) {
						return true;
					});
					return;
				}
			} else {
				planData = getPlanList(projectId);
				treeNodeIndex = planData.length - 2;
				loadTreeView("");
				showMsgBox("删除方案成功！",function(type) {
					return true;
				});
			}
			JyyLoading.end();
		});
	});
	$('#btnClose').click(function(){
		$('#wizardMask').hide();
		$('#runPanel').hide();
	});
	$('#btnSave').click(function(){
		//调用保存设置参数的URL，并获取返回值
		var result = {error:"保存参数失败！"};
		if (!result || result.error) {
			showMsgBox("保存参数失败！",function(type){
				return true;
			});
			return;
		}
		$('#runPanel').hide();
	});
	
	$('#btnRoute').click(function(){
		if(sessionStorage.getItem("pageType_")) pageType_=sessionStorage.getItem("pageType_");
		if(pageType_ == "meos"){
			pageType_="route";
			if(modelId == 9){
				$("#contentPanel")[0].src = "../g/pages/meopMap.html?projectId="+projectId+"&debug=1";

			}else{
				
				$("#contentPanel")[0].src = "../g/pages/routeMap.html?projectId="+projectId+"&debug=1";
			}
			$("#btnRoute").css("background-color","white");
			$("#btnMeos").css("width","150px");
			$("#btnMeos").css("background-color","#b0b6bd");
		}
		sessionStorage.setItem("pageType_", 'route'); 
	});

	$('#btnMeos').click(function(){
		$('#buttonSave').click()
		if(sessionStorage.getItem("pageType_")) pageType_=sessionStorage.getItem("pageType_");

		if(pageType_ == "route" || pageType_ == "stationMap"){
			
			$(".msgbox").hide()
			SaveConfirmMsgBox("", function(type) {
				if(type == "cancel"){
					$("#contentPanel")[0].src = "../pages/dataSourceToMeos.html?projectId="+projectId;
					$("#btnRoute").css("background-color","#b0b6bd");
					
					$("#btnMeos").css("width","115px");
					$("#btnMeos").css("background-color","white");
					pageType_="meos";
					sessionStorage.setItem("pageType_", 'meos'); 
				}else{
					$("#contentPanel")[0].contentWindow.doSave_()
					$("#contentPanel")[0].src = "../pages/dataSourceToMeos.html?projectId="+projectId;
					$("#btnRoute").css("background-color","#b0b6bd");
					
					$("#btnMeos").css("width","115px");
					$("#btnMeos").css("background-color","white");
					pageType_="meos";
					sessionStorage.setItem("pageType_", 'meos'); 
				}
			});
			 
		}
	});
	
	$('#btnRun').click(function(){
		planIds = [];
		/*var j = 0;
		for(var i = 0 ; i <listview.nodes.length ; i++){
			if(listview.nodes[i].checkbox.checked == true){
				planIds[j] = listview.nodes[i].data.code;
				j++;
			}
		}*/

		planIds.push(planId);
		$.ajax({
			async:false,
			url:'../pv/work/setParamsMeos',
			type:'POST',
			dataType:'json',
			data:{"paramList":JSON.stringify(paramList),"planId":JSON.stringify(planIds)}
		});
		if(modelId==9){
			showProcessBar();
			
		}else{
			//展示进度窗口
			$('#progressDiv').show();
			
			document.getElementById("btnClosRun").onclick=null;
			//循环查看状态
			var t = setInterval(function(){
				$.ajax({
					url: '../pv/executivemeos/getProgressInfo',
					dataType: 'text'
				}).done(function(res) {
					var r = eval("("+res+")");
					$('#progressStrip').css({width:r.progressBar+"%"});
					$('#progressStrip').find("span").text(r.progressBar + "%");
					$('#progressText').html(r.result);
					$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
					$("#progressState").setStep(r.progressState);
				});
			}, 1000);
			
			$('#progressClose').click(function(){
		    	
		    	layui.use('layer', function(){ //独立版的layer无需执行这一句
					  var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
					  
					  layer.confirm('选择【终止计算】，将结束计算', {
						  btn: ['后台计算','终止计算'] //按钮
						}, function(){
						  layer.msg('后台计算', {icon: 1});
						  $('#progressDiv').hide();
							$('#wizardMask').hide();
						}, function(){
							killNowTask();
							layer.msg('终止计算', {icon: 1});
							$('#progressDiv').hide();
							$('#wizardMask').hide();
						});
					});
		    	
				clearInterval(t);
		    	
			});
			
			$.ajax({
				dataType: "json",
				data:{planId:planId},
				url: "../pv/executivemeos/implementExeMeos"
			}).done(function(res) {
				clearInterval(t);
				$('#progressStrip').css({width:"100%"});
				$('#progressStrip').find("span").text("100%");
				$('#progressText').html(res.result);
				$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
				$("#progressState").setStep(5);
				$('#progressText').html(res.result+'<br/>【提示信息】计算完成！');
				//$('#progressDiv').hide();
				
				$('#btnClosRun')[0].onclick=function(){
					$('#progressStrip').css({width:"0%"});
					$('#progressStrip').find("span").text("0%");
					$('#progressText').html("");
					$("#progressState").setStep(0);
			    	
				 	$('#progressDiv').hide();
					$('#wizardMask').hide();
				};
			}).fail(function(data, status, xhr){
				clearInterval(t);
				document.getElementById("btnClosRun").onclick=null;
			});
		}
		$('#runPanel').hide();
	});
	$('#btnReturn').click(function(){
		$('#wizardMask').hide();
		$('#runPanel').hide();
	});
	$('#checkCloseBtn').click(function(){
		$('#checkPanel').hide();
	});
	$('#btnCheck').click(function(){
		let meosStartDate = paramList[0].MEOS_BEGINDAY.toString();
		let meosEndDate = paramList[0].MEOS_ENDDAY.toString();
		meosStartDate = meosStartDate.substr(0,4)+"-"+meosStartDate.substr(4,2)+"-"+meosStartDate.substr(6,2);
		meosEndDate = meosEndDate.substr(0,4)+"-"+meosEndDate.substr(4,2)+"-"+meosEndDate.substr(6,2);
		let days = getDaysBetween(meosStartDate, meosEndDate);
		if(days == 0) {
			showMsgBox("评估时间范围错误！",function(type) {
				return true;
			});
			return;
		}
		var planIds = [];
		planIds.push(planId);
		$.ajax({
			async:false,
			url:'../pv/work/setParamsMeos',
			type:'POST',
			dataType:'json',
			data:{"paramList":JSON.stringify(paramList),"planId":JSON.stringify(planIds)},
			success:function() {
				$("#checkText").html("正在检查中，请稍等...");
				$("#checkPanel").show();
				$("#checkPanel").draggable();
				invoke("simulationCheck", {planId:planId}, function(data){
					$("#checkText").html(data.msg);
			    });
			}
		});
	});

	initSystem();
	loadTreeView(pageType);
	getParams();
	loadRunPage();
	initCommonEvent();
	onResize();
}
function initSystem(){
	var sys = sessionStorage.getItem("sys");
	if(sys=='1'){
		$("#mapGird").css('display','block');
	}
	invoke_sys('getSystem', {sys:sys}, function(data){
		if(data.data.length>0){
			$('#logo_icon').click(function(){
				window.location.href="../"+data.data[0].sys_index;
			});
			$('#login_index').click(function(){
				window.location.href="../"+data.data[0].sys_index;
			});
			$('#login_exit').click(function(){
				$.ajax({
		            url: '../pv/login/logout',
		            dataType: 'text'
		        }).done(function(res) {
		    	});
				window.location.href="../"+data.data[0].sys_index;
			});
			$("#logo_icon").attr('src',' ../images/'+data.data[0].logo_pic);
			$("#logo_title").text(data.data[0].logo_text);
		}else{
			window.parent.location.href="login.html";
		}
		
		
    });
};
function initPlanList(){
	var sel = $('#inCopyPlanDemo');
	var method ='getCompDatas';
	invoke(method, {userId:userId,modelId:modelId}, function(data){
		var content = '';
		sel.empty();
		$.each(data.compData,function(i,n){
			if(i == 0 || (i!=0 && n.projectId!=data.compData[i-1].projectId)) {
				if(i!=0){
					content += "</optgroup>";
				}
				content += "<optgroup label='" + n.projectName + "'>";
			}
			content += "<option value='" + n.planCode + "'>"+ n.planName+"</option>";
		});
		sel.append("<option value=''>-</option>"+content+"</optgroup>");
		sel.selectpicker('refresh');

    });
};

//展示登陆用户信息
function showLoginInfo(){
		$.ajax({
			url: '../pv/login/loginInfo',
			type: "get",
			success:function(res){
				result = res;
    			if (result != "") {
    				$("#login_name").text(result);
    			}else {
    				$("#login").text("登录/注册");
    				window.parent.location.href="login.html";
    				
    			}
		}
	})
}

function onResize() {
	console.log("onResize");
	resizeAddPlanPage();
	resizeRunPage();
};
function onMouseOver(e) {
	var event = e || window.event;
	var target = event.target;
	if (target.id == "headerMenu") {
		$("#treePanel")[0].style.visibility = "visible";
	} else {
		var treeNode = $(target).parents("#treePanel");
		if(target.id){
			if (target.id == "treePanel" || treeNode && treeNode.length > 0 || target.id == "mouseDiv" || target.parentElement.id== "mouseDiv" ) {
				if(target.parentElement.id== "mouseDiv"|| target.id == "mouseDiv"){
					
				}else{
					$("#mouseDiv").css('display','none')
					
				}
			} else {
				$("#mouseDiv").css('display','none')
				$("#treePanel")[0].style.visibility = "hidden";
			}
		}
	}
	if(target.className =="gopt_tab_panel"  ){
		$(".rxdate")[0].style.display = "none"; $(".rxdate")[1].style.display = "none";
	}
};

function onContextMenu (e,id){
	if(!e)return;
	var clintX=e.clientX;  
	var clintY=e.clientY;
	var scollTop=document.documentElement.scrollTop|| document.body.scrollTop;   
	var scollLeft=document.documentElement.scrollLeft || document.body.scrollLeft
	var el=document.getElementById('mouseDiv');
	el.style.left=clintX+scollLeft+'px';
	el.style.top=clintY+scollTop+'px';
	el.style.display='block';
	document.getElementById("mouseDiv").onclick=function(res){
		el.style.display='none';
		var name ='';
		var demo ='';
		for (var i = 0; i < planData.length; i++) {
			if(planData[i].id==id){
				 name = planData[i].name;
				 demo = planData[i].demo;
			}
		}
		if(res.target.textContent=="修改方案"){
			$("#inPlanNameEdit")[0].setValue(name);
			$("#inPlanDemoEdit")[0].setValue(demo);
			$('#wizardMask').show();
			$('#planPanelEdit').show();
		}
		if(res.target.textContent=="删除方案"){
			if(planData.length == 2) {
				showMsgBox("必须要有一个方案！",function(type) {
					return true;
				});
				return;
			}
			$("#inPlanNameDele")[0].setValue(name);
			$("#inPlanDemoDele")[0].setValue(demo);
			$('#wizardMask').show();
			$('#planPanelDele').show();
		}
	}
}
/*function onMenuClick(flag) {
	if (flag == 0) {
		loadTreeView("");
		$('#tabsDiv').css('display','block');
	} else if (flag == 1) {
		$('#tabsDiv').css('display','block');
		$('#wizardMask').show();
		$('#runPanel').show();
	} else if (flag == 2) {
		$('#tabsDiv').css('display','none');
		onResultClick();
	}
}*/

function onMenuClick(flag) {
	if (flag == 0) {
		loadTreeView("");
		$('#tabsDiv').css('display','block');
	} else if (flag == 1) {
		getParams();
		tabs[0].click();
		$('#wizardMask').show();
		$('#runPanel').show();
	} else if (flag == 2) {
		$('#tabsDiv').css('display','none');
		$("#contentPanel")[0].src = "../pages/resultsDisplay.html?projectId="+planId+"&modelId="+modelId;
	}
}

function loadTreeView(pageType) {
	var treeNodes = [];
	var treeProjectPanel = $('#treeProjectPanel')[0];
	var treeProjectIcon = $('#treeProjectIcon')[0];
	var treeProjectName = $('#treeProjectName')[0];
	var treePlanTree = $('#treePlanPanel')[0];

	treeProjectName.innerHTML = projectData.name;
	var textHeight = $('#treeProjectName').height();
	//var textHeight = RxCommon.getTextSize(treeProjectName, projectData.name).height;
	console.log("projectName.height = " + textHeight);
	treeProjectPanel.style.height = (textHeight+20) + "px";
	treeProjectIcon.style.top = ((textHeight+20-16)/2) + "px";
	treePlanTree.style.top = (95 + textHeight + 20) + "px";

	treePlanTree.dispose = RxCommon.dispose;
	treePlanTree.innerHTML = "";
	var top = 0;
	for (var i = 1; i < planData.length; i++) {
		var treeNode = RxCommon.ce(treePlanTree, null, "div", "tree_plan");
		var treeText = RxCommon.ce(treeNode, null, "div", "tree_plan_text");
		treeText.innerHTML = planData[i].name;
		textHeight = $(treeText).height();
		//textHeight = RxCommon.getTextSize(treeText, planData[i].name).height;
		console.log("planName.height = " + textHeight);
		treeNode.style.height = (textHeight+20) + "px";
		treeNode.style.top = (top) + "px";
		top = top + textHeight + 20;
		treeNode.selected = false;
		treeNode.text = treeText;
		treeNode.data = planData[i];
		treeNode.onmouseover = function() {
			this.className = "tree_plan_selected";
			this.text.className = "tree_plan_text_selected";
		};
		treeNode.onmouseout = function() {
			if (this.selected == false) {
				this.className = "tree_plan";
				this.text.className = "tree_plan_text";
			}
		};
		treeNode.onclick = function() {
			planId = this.data.id;
			for (var j = 0; j < treeNodes.length; j++) {
				if (this == treeNodes[j]) {
					$('#planNameList')[0].innerHTML = '当前方案：'+projectData.name+' > '+treeNodes[j].data.name;				
					treeNodes[j].selected = true;
					treeNodes[j].className = "tree_plan_selected";
					treeNodes[j].text.className = "tree_plan_text_selected";
					planId = treeNodes[j].data.id;
					treeNodeIndex = j;
					onPlanClick(pageType);
				} else {
					treeNodes[j].selected = false;
					treeNodes[j].className = "tree_plan";
					treeNodes[j].text.className = "tree_plan_text";
				}
			}
		}
		treeNode.oncontextmenu = function(e) {
			for (var j = 0; j < treeNodes.length; j++) {
				if (this == treeNodes[j]) {
					$('#planNameList')[0].innerHTML = '当前方案：'+projectData.name+' > '+treeNodes[j].data.name;
					treeNodes[j].selected = true;
					treeNodes[j].className = "tree_plan_selected";
					treeNodes[j].text.className = "tree_plan_text_selected";
					planId = treeNodes[j].data.id;
					treeNodeIndex = j;
					onContextMenu(e, planId);
					onPlanClick(pageType);
				} else {
					treeNodes[j].selected = false;
					treeNodes[j].className = "tree_plan";
					treeNodes[j].text.className = "tree_plan_text";
				}
			}
		}
		treeNodes[treeNodes.length] = treeNode;
	}
	if (treeNodes.length > 0) {
		treeNodes[treeNodeIndex].click();
	}
}

function onPlanClick (pageType) {
	console.log("projectId = " + projectId + ",planId" + planId);
	$('#tabsDiv').css('display','block');
	if(sessionStorage.getItem("pageType_")) pageType_=sessionStorage.getItem("pageType_"); pageType=pageType_;
	if(pageType == "meos"){
		$("#contentPanel")[0].src = "../pages/dataSourceToMeos.html?projectId="+projectId;
	}else {
		if(modelId == 9){
			$("#contentPanel")[0].src = "../g/pages/meopMap.html?projectId="+projectId;

		}else{
			
			$("#contentPanel")[0].src = "../g/pages/routeMap.html?projectId="+projectId+"&debug=1";
		}
	}
}
function iframeOnload () {
	JyyLoading.end();
}
function onResultClick () {
	console.log("projectId = " + projectId + ",planId" + planId);
	var iframe = document.getElementById("contentPanel");
	if (iframe.attachEvent){
        iframe.attachEvent("onload", function(){
            iframeOnload();
         });
    }else{
        iframe.onload = function(){
            iframeOnload();
        };
    }
	JyyLoading.start();
	//$("#contentPanel")[0].src = "http://www.cloudgopt.com/dactive/pages/report.jsp?projectId="+projectId+"&planId="+planId;
	$("#contentPanel")[0].src = "http://www.cloudgopt.com/dactive/pages/report.jsp?projectId="+projectId+"&planId="+planId;
}
function loadRunPage() {
	
	panel = $('#panelTab')[0];
	panel.dispose = RxCommon.dispose;
	$('.gopt_tab').each(function() {
		var i = tabs.length;
		tabs[i] = $(this)[0];
		tabs[i].selected = false;
		tabs[i].onclick = function() {
			console.log($(this).text());
			for (var n = 0; n < tabs.length; n++) {
				if (tabs[n] == this) {
					tabs[n].selected = true;
					tabs[n].className = "gopt_tab_selected";
					$('.gopt_tab_line')[0].style.width = tabs[n].style.left;
					$('.gopt_tab_line')[1].style.left = ($(tabs[n]).position().left + $(tabs[n]).width()) + "px";
					panel.dispose();
					createTabView(n);
				} else {
					tabs[n].selected = false;
					tabs[n].className = "gopt_tab";
				}
			}
		};
	});
	tabs[0].click();
}
function createTabView(index) {
	if (index == 0) {
		createJbcs();
	} else if (index == 1) {
		//createYxxx();
	} else if (index == 2) {
		createDyxx();
	} else if (index == 3) {
		createTfxx();
	} else if (index == 4) {
		createJxxx();
	} else if (index == 5) {
		createSdyxxx();
	} else if (index == 6) {
		createXnyyxxx();
	} else if (index == 7) {
		createYhxx();
	}
}

function createJbcs() {
	var isReadOnly = false;
	if(userId >= 1000 && userId <= 1500) {
		isReadOnly = true;
	}
	console.log("createJbcs");
	/*var group = createGroup("选择方案", 10, 20, 240, 300);
	panel.appendChild(group);*/

	var data = getPlanInfo(projectId, planId);
	for (var i = 1; i < data.length; i++) {
//		listdata[listdata.length] = {code:data[i].id,name:data[i].name};
		listdata[i-1] = {code:data[i].id,name:data[i].name};
		/*if(i == 1){
			listdata[0].checked = true;
		}*/
	}
	if(listdata.length != 0) $("#lblInfo").text("正在设置的方案：" + listdata[0].name);
	/*listview = RxTree.init(null, listdata, {listMode:"listbox", checkMode:"checkbox"}, {top:"20px",left:"10px",width:"216px", height:"210px"}, function(param) {
		console.log(param);
		$("#lblInfo").text("正在设置的方案：方案" + param.node.data.name);
	});
	group.addView(listview);

	var btnSelectView = RxButton.init(null, "全选", {top:"243px",left:"33px",width:"80px"}, function(param){
		for(var i = 0 ; i < listview.nodes.length ; i++){
			listview.nodes[i].check(true);
		}
	});
	group.addView(btnSelectView);
	var btnUnSelectView = RxButton.init(null, "全清", {top:"243px",left:"125px",width:"80px"}, function(param){
		for(var i = 0 ; i < listview.nodes.length ; i++){
			listview.nodes[i].check(false);
		}
	});
	group.addView(btnUnSelectView);*/

	group = createGroup("评估时间范围", 10, 20, 240, 110, 96);
	panel.appendChild(group);
	//获取评估时间id
	$("#runPanel").on("click",function(event){
		var classStr = $(event.target).attr('class');
		if(classStr != 'rxdroplist_focus' && classStr != 'rxdroplist_input') {
			$('.rxdate').hide();
		}
	});
//	$('.rxdroplist_focus').click(function(event){
//		event.stopPropagation();
//		});
//	$('.rxdroplist_tip').on("click",function(e){
//		e.stopPropagation(); 
//		console.log('rxdate')
//	});

	var date = new Date();
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BEGINDAY)){
		var dateconfigBegin = {
				type:6,
				years:{year:paramList[0].MEOS_BEGINDAY.toString().slice(0,4),month:paramList[0].MEOS_BEGINDAY.toString().slice(4,6),day:paramList[0].MEOS_BEGINDAY.toString().slice(6,8)},
				formatType:{
					type0 : "YYYY-MM",
					type1 : "YYYY",
					type2 : "YYYY-J",
					type3 : "YYYY-B",
					type4 : "YYYY-W",
					type5 : "YYYY-MM-X",
					type6 : "YYYY-MM-DD"
				}
			};
	}else{
		var dateconfigBegin = {
				type:6,
				years:{year:date.getFullYear(),month:(date.getMonth()),day:date.getDate()},
				formatType:{
					type0 : "YYYY-MM",
					type1 : "YYYY",
					type2 : "YYYY-J",
					type3 : "YYYY-B",
					type4 : "YYYY-W",
					type5 : "YYYY-MM-X",
					type6 : "YYYY-MM-DD"
				}
			};
	}
	
	group.addView(RxLabel.init(null, "从", {top:"20px",left:"10px",width:"30px"}));
	var fromDateList = RxDate.init(null, dateconfigBegin, function(param){
		var year = dateconfigBegin.years.year.toString()
		var month = dateconfigBegin.years.month.toString()
		if(month.length==1){
			month="0"+month
		}
		var day = dateconfigBegin.years.day.toString()
		if(day.length==1){
			day="0"+day
		}
		paramList[0].MEOS_BEGINDAY = year+month+day
		if(paramList[0].MEOS_ENDDAY<paramList[0].MEOS_BEGINDAY){
			alert("起始时间大于结束时间!")
		}
	});
	var fromDateDrop = RxDropList.init(null, "", {list:fromDateList, isFixed:true}, {top:"20px",left:"60px",width:"160px"}, function(param){
		console.log(param);
	});
	group.addView(fromDateDrop);

	group.addView(RxLabel.init(null, "到", {top:"55px",left:"10px",width:"30px"}));
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_ENDDAY)){
		var dateconfigEnd = {
				type:6,
				years:{year:paramList[0].MEOS_ENDDAY.toString().slice(0,4),month:paramList[0].MEOS_ENDDAY.toString().slice(4,6),day:paramList[0].MEOS_ENDDAY.toString().slice(6,8)},
				formatType:{
					type0 : "YYYY-MM",
					type1 : "YYYY",
					type2 : "YYYY-J",
					type3 : "YYYY-B",
					type4 : "YYYY-W",
					type5 : "YYYY-MM-X",
					type6 : "YYYY-MM-DD"
				}
			};
	}else{
		var dateconfigEnd = {
				type:6,
				years:{year:date.getFullYear(),month:(date.getMonth()),day:date.getDate()},
				formatType:{
					type0 : "YYYY-MM",
					type1 : "YYYY",
					type2 : "YYYY-J",
					type3 : "YYYY-B",
					type4 : "YYYY-W",
					type5 : "YYYY-MM-X",
					type6 : "YYYY-MM-DD"
				}
			};
	}
	var toDateList = RxDate.init(null, dateconfigEnd, function(param){
		var year = dateconfigEnd.years.year.toString()
		var month = dateconfigEnd.years.month.toString()
		if(month.length==1){
			month="0"+month
		}
		var day = dateconfigEnd.years.day.toString()
		if(day.length==1){
			day="0"+day
		}
		paramList[0].MEOS_ENDDAY = year+month+day;
		if(paramList[0].MEOS_ENDDAY<paramList[0].MEOS_BEGINDAY){
			alert("起始时间大于结束时间!")
		}
	});
	var toDateDrop = RxDropList.init(null, "", {list:toDateList, isFixed:true}, {top:"55px",left:"60px",width:"160px"}, function(param){
		console.log(param);
	});
	group.addView(toDateDrop);

	group = createGroup("程序优化核心选项", 120, 20, 300, 240, 128);
	panel.appendChild(group);
	group.addView(RxLabel.init(null, "计算时间限制", {top:"15px",left:"20px",width:"100px",textAlign:"left"}));
	
	var txtYhxx01Checked = 5;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_TIMEOUT)){
		txtYhxx01Checked = paramList[0].DSED_TIMEOUT;
	}
	var txtYhxx01 = RxText.init(null, txtYhxx01Checked, "", {top:"15px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_TIMEOUT = param.value;
		}
	});
	group.addView(txtYhxx01);
	group.addView(RxLabel.init(null, "秒", {top:"15px",left:"230px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "最大迭代次数", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx02Checked = 3000;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MAXITERATIONS)){
		txtYhxx02Checked = paramList[0].DSED_MAXITERATIONS;
	}
	var txtYhxx02 = RxText.init(null, txtYhxx02Checked, "", {top:"45px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_MAXITERATIONS = param.value;
		}
	});
	group.addView(txtYhxx02);
	group.addView(RxLabel.init(null, "次", {top:"45px",left:"230px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "优化计算间隙", {top:"75px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx03Checked = 0.01;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PRECISION)){
		txtYhxx03Checked = paramList[0].DSED_PRECISION;
	}
	var txtYhxx03 = RxText.init(null, txtYhxx03Checked, "", {top:"75px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PRECISION = param.value;
		}
	});
	group.addView(txtYhxx03);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"230px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "是否使用电源\n的分时价格", {top:"105px",left:"20px",width:"100px",height:"48px",textAlign:"left"}));
	var lstYhxx01 = RxTree.init(null, [{code:0,name:"使用固定成本"},{code:1,name:"使用分时价格"}], {listMode:'listbox', isMenu:true}, {height:'60px'}, function(data){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].MEOS_IFCAL)){
			paramList[0].MEOS_IFCAL = data.node.data.code;
		}
	});
	var drpYhxx01 = RxDropList.init(null, "", {list:lstYhxx01}, {position:'absolute', left:'122px', top:'120px', width:'130px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpYhxx01);
	var lstYhxx01Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].MEOS_IFCAL)){
		if(paramList[0].MEOS_IFCAL == 1){
			lstYhxx01Checked = 1;
		}
	}
	lstYhxx01.checkNode(lstYhxx01Checked, true);
	group.addView(RxLabel.init(null, "是否使用电源的\n分时碳排放系数", {top:"160px",left:"20px",width:"120px",height:"48px",textAlign:"left"}));
	var lstYhxx02 = RxTree.init(null, [{code:0,name:"使用固定系数"},{code:1,name:"使用分时系数"}], {listMode:'listbox', isMenu:true}, {height:'60px'}, function(data){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].MEOS_IFCARBORN)){
			paramList[0].MEOS_IFCARBORN = data.node.data.code;
		}
	});
	var drpYhxx02 = RxDropList.init(null, "", {list:lstYhxx02}, {position:'absolute', left:'142px', top:'175px', width:'130px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpYhxx02);
	var lstYhxx02Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].MEOS_IFCARBORN)){
		if(paramList[0].MEOS_IFCARBORN == 1){
			lstYhxx02Checked = 1;
		}
	}
	lstYhxx02.checkNode(lstYhxx02Checked, true);
	if(isReadOnly) {
		fromDateDrop.input.style.color='#c8c8c8'
		fromDateDrop.style.pointerEvents='none';
		toDateDrop.input.style.color='#c8c8c8'
		toDateDrop.style.pointerEvents='none';
		txtYhxx01.setReadOnly(true);
		txtYhxx01.input.style.color="#c8c8c8";
		txtYhxx02.setReadOnly(true);
		txtYhxx02.input.style.color="#c8c8c8";
		txtYhxx03.setReadOnly(true);
		txtYhxx03.input.style.color="#c8c8c8";
		drpYhxx01.input.style.color='#c8c8c8'
		drpYhxx01.style.pointerEvents='none';
		drpYhxx02.input.style.color='#c8c8c8'
		drpYhxx02.style.pointerEvents='none';
	}
	
	
	/*group = createGroup("典型场景选择", 130, 280, 240, 180, 96);
	panel.appendChild(group);
	var rdoSence1Checked = true;
	var rdoSence2Checked = false;
	var rdoSence3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RESOLUTION)){
		if(paramList[0].DSED_RESOLUTION == 1){
			rdoSence1Checked = false;
			rdoSence2Checked = true;
			rdoSence3Checked = false;
		}else if (paramList[0].DSED_RESOLUTION == 2){
			rdoSence1Checked = false;
			rdoSence2Checked = false;
			rdoSence3Checked = true;
		}
	}
	var rdoSence1 = JyyRadio.init(null, "sence", rdoSence1Checked,  "0", "逐日模拟", {top:"20px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_RESOLUTION = 0;
		chkSence1.disable(true);
		chkSence2.disable(true);
		chkSence3.disable(true);
		chkSence4.disable(true);
	});
	var rdoSence2 = JyyRadio.init(null, "sence", rdoSence2Checked, "1", "月典型日", {top:"50px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_RESOLUTION = 1;
		chkSence1.disable(false);
		chkSence2.disable(false);
		chkSence3.disable(false);
		chkSence4.disable(false);
	});
	var rdoSence3 = JyyRadio.init(null, "sence", rdoSence3Checked, "2", "年典型日", {top:"80px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_RESOLUTION = 2;
		chkSence1.disable(false);
		chkSence2.disable(false);
		chkSence3.disable(false);
		chkSence4.disable(false);
	});
	group.addView(rdoSence1);
	group.addView(rdoSence2);
	group.addView(rdoSence3);
	
	var chkSence1Checked = false;
	var chkSence2Checked = false;
	var chkSence3Checked = false;
	var chkSence4Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MAXLOAD)){
		if(paramList[0].DSED_SCENARIO_MAXLOAD == 1){
			chkSence1Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MINLOAD)){
		if(paramList[0].DSED_SCENARIO_MINLOAD == 1){
			chkSence2Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MAXPEAK)){
		if(paramList[0].DSED_SCENARIO_MAXPEAK == 1){
			chkSence3Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MINPEAK)){
		if(paramList[0].DSED_SCENARIO_MINPEAK == 1){
			chkSence4Checked = true;
		}
	}
	var chkSence1 = JyyCheckBox.init(null, chkSence1Checked, "1", "最大负荷日", {top:"20px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MAXLOAD = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MAXLOAD = 0;
		}
	});
	var chkSence2 = JyyCheckBox.init(null, chkSence2Checked, "1", "最小负荷日", {top:"50px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MINLOAD = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MINLOAD = 0;
		}
	});
	var chkSence3 = JyyCheckBox.init(null, chkSence3Checked, "1", "最大峰谷差日", {top:"80px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MAXPEAK = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MAXPEAK = 0;
		}
	});
	var chkSence4 = JyyCheckBox.init(null, chkSence4Checked, "1", "最小峰谷差日", {top:"110px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MINPEAK = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MINPEAK = 0;
		}
	});
	chkSence1.disable(true);
	chkSence2.disable(true);
	chkSence3.disable(true);
	chkSence4.disable(true);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RESOLUTION)){
		if(paramList[0].DSED_RESOLUTION == 1){
			chkSence1.disable(false);
			chkSence2.disable(false);
			chkSence3.disable(false);
			chkSence4.disable(false);
		}else if (paramList[0].DSED_RESOLUTION == 2){
			chkSence1.disable(false);
			chkSence2.disable(false);
			chkSence3.disable(false);
			chkSence4.disable(false);
		}
	}
	group.addView(chkSence1);
	group.addView(chkSence2);
	group.addView(chkSence3);
	group.addView(chkSence4);*/
	
}

function createYxxx() {
	var group = createGroup("优化目标", 10, 20, 580, 100);
	panel.appendChild(group);
	
	var rdoYhmb1Checked = true;
	var rdoYhmb2Checked = false;
	var rdoYhmb3Checked = false;
	var rdoYhmb4Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_OPTIMIZEOPTION)){
		if(paramList[0].DSED_OPTIMIZEOPTION == 1){
			rdoYhmb1Checked = false;
			rdoYhmb2Checked = true;
			rdoYhmb3Checked = false;
			rdoYhmb4Checked = false;
		}else if (paramList[0].DSED_OPTIMIZEOPTION == 2){
			rdoYhmb1Checked = false;
			rdoYhmb2Checked = false;
			rdoYhmb3Checked = true;
			rdoYhmb4Checked = false;
		}else if (paramList[0].DSED_OPTIMIZEOPTION == 3){
			rdoYhmb1Checked = false;
			rdoYhmb2Checked = false;
			rdoYhmb3Checked = false;
			rdoYhmb4Checked = true;
		}
	}
	var rdoYhmb1 = JyyRadio.init(null, "t1g1", rdoYhmb1Checked,  "0", "运行成本最低", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 0;
		chkYhmb1.disable(false);
		txtYhmb.setReadOnly(false);
		label1.style.color = '#666666';
		label2.style.color = '#666666';
	});
	var rdoYhmb2 = JyyRadio.init(null, "t1g1", rdoYhmb2Checked, "1", "够电费用最低", {top:"15px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 1;
		chkYhmb1.disable(false);
		txtYhmb.setReadOnly(false);
		label1.style.color = '#666666';
		label2.style.color = '#666666';
	});
	var rdoYhmb3 = JyyRadio.init(null, "t1g1", rdoYhmb3Checked, "2", "三公调整", {top:"15px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 2;
		chkYhmb1.disable(false);
		txtYhmb.setReadOnly(false);
		label1.style.color = '#666666';
		label2.style.color = '#666666';
	});
	var rdoYhmb4 = JyyRadio.init(null, "t1g1", rdoYhmb4Checked, "3", "节能发电调度", {top:"15px",left:"440px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 3;
		chkYhmb1.disable(true);
		txtYhmb.setReadOnly(true);
		label1.style.color = '#c6c6c6';
		label2.style.color = '#c6c6c6';
	});
	group.addView(rdoYhmb1);
	group.addView(rdoYhmb2);
	group.addView(rdoYhmb3);
	group.addView(rdoYhmb4);
	
	var chkYhmb1Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_EMISSION_CORRECTION)){
		if(paramList[0].DSED_EMISSION_CORRECTION != 0){
			chkYhmb1Checked = true;
		}
	}
	var chkYhmb1 = JyyCheckBox.init(null, chkYhmb1Checked, "1", "考虑排放惩罚", {top:"45px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_EMISSION_CORRECTION = 1;
		}else if(param.checked == false){
			paramList[0].DSED_EMISSION_CORRECTION = 0;
		}
	});
	chkYhmb1.disable(false);
	if(paramList.length>0 && paramList[0].DSED_OPTIMIZEOPTION == 3){
		chkYhmb1.disable(true);
	}
	var label1 = RxLabel.init(null, "惩罚系数", {top:"45px",left:"160px",width:"80px",textAlign:"left"});
	group.addView(label1);
	
	var txtYhmbChecked = 20;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_EMISSION_RATIO)){
		var txtYhmbChecked = paramList[0].DSED_EMISSION_RATIO;
	}
		var txtYhmb = RxText.init(null, txtYhmbChecked, "", {top:"45px",left:"230px",width:"53px"},function(param){
			if(param.name == "onchange"){
				paramList[0].DSED_EMISSION_RATIO = param.value;
			}
		});
	var label2 = RxLabel.init(null, "元/吨CO2", {top:"45px",left:"290px",width:"80px",textAlign:"left"})
	if(paramList.length>0 && paramList[0].DSED_OPTIMIZEOPTION == 3){
		txtYhmb.setReadOnly(true);
		label1.style.color = '#c6c6c6';
		label2.style.color = '#c6c6c6';
	}
	group.addView(label2);
	group.addView(txtYhmb);
	var chkYhmb2Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_TRANSLOSS_CORRECTION)){
		if(paramList[0].DSED_TRANSLOSS_CORRECTION == 1){
			chkYhmb2Checked = true;
		}
	}
	var chkYhmb2 = JyyCheckBox.init(null, chkYhmb2Checked, "1", "考虑网损修正", {top:"45px",left:"440px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_TRANSLOSS_CORRECTION = 1;
		}else if(param.checked == false){
			paramList[0].DSED_TRANSLOSS_CORRECTION = 0;
		}
	});
	group.addView(chkYhmb1);
	group.addView(chkYhmb2);

	group = createGroup("可选约束", 120, 20, 580, 65);
	panel.appendChild(group);
	var chkKxys1Checked = false;
	var chkKxys2Checked = false;
	var chkKxys3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GRIDCONS)){
		if(paramList[0].DSED_GRIDCONS == 1){
			chkKxys1Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_FLOWGATECONS)){
		if(paramList[0].DSED_FLOWGATECONS == 1){
			chkKxys2Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GRIDCONSITERA)){
		if(paramList[0].DSED_GRIDCONSITERA == 1){
			chkKxys3Checked = true;
		}
	}
	var chkKxys1 = JyyCheckBox.init(null, chkKxys1Checked, "1", "考虑线路约束", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GRIDCONS = 1;
		}else if(param.checked == false){
			paramList[0].DSED_GRIDCONS = 0;
		}
	});
	var chkKxys2 = JyyCheckBox.init(null, chkKxys2Checked, "1", "考虑断面约束", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_FLOWGATECONS = 1;
		}else if(param.checked == false){
			paramList[0].DSED_FLOWGATECONS = 0;
		}
	});
	var chkKxys3 = JyyCheckBox.init(null, chkKxys3Checked, "1", "是否采用迭代加速策略", {top:"15px",left:"300px",width:"190px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GRIDCONSITERA = 1;
		}else if(param.checked == false){
			paramList[0].DSED_GRIDCONSITERA = 0;
		}
	});
	group.addView(chkKxys1);
	group.addView(chkKxys2);
	group.addView(chkKxys3);

	group = createGroup("备用选项", 195, 20, 580, 190);
	panel.appendChild(group);
	
	var chkXtzby1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RUTYPE == 0){
			chkXtzby1Checked = false;
		}
	}
	var chkXtzby1 = JyyCheckBox.init(null, chkXtzby1Checked, "1", "系统正备用", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_RUTYPE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_RUTYPE = 0;
		}
	});
	group.addView(chkXtzby1);
	
	var txtXtzby1Checked = 0.05;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RU)){
		txtXtzby1Checked = paramList[0].DSED_RU;
	}
	var txtXtzby1 = RxText.init(null, txtXtzby1Checked, "", {top:"15px",left:"160px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RU = param.value;
		}
	});
	group.addView(txtXtzby1);

	
	var rdoXtzby1Checked = true;
	var rdoXtzby2Checked = false;
	var rdoXtzby3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RUTYPE == 2){
			rdoXtzby1Checked = false;
			rdoXtzby2Checked = true;
			rdoXtzby3Checked = false;
		}else if(paramList[0].DSED_RUTYPE == 3){
			rdoXtzby1Checked = false;
			rdoXtzby2Checked = false;
			rdoXtzby3Checked = true;
		}
	}
	var rdoXtzby1 = JyyRadio.init(null, "t1g2", rdoXtzby1Checked,  "1", "全系统留取", {top:"45px",left:"20px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
			if(paramList[0].DSED_RUTYPE != 0){
				paramList[0].DSED_RUTYPE = 1;
			}else{
				paramList[0].DSED_RUTYPE = 0;
			}
		}
	});
	var rdoXtzby2 = JyyRadio.init(null, "t1g2", rdoXtzby2Checked, "2", "按区域留取", {top:"45px",left:"160px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
			if(paramList[0].DSED_RUTYPE != 0){
				paramList[0].DSED_RUTYPE = 2;
			}else{
				paramList[0].DSED_RUTYPE = 0;
			}
		}
	});
	var rdoXtzby3 = JyyRadio.init(null, "t1g2", rdoXtzby3Checked, "3", "按机组留取", {top:"45px",left:"300px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
			if(paramList[0].DSED_RUTYPE != 0){
				paramList[0].DSED_RUTYPE = 3;
			}else{
				paramList[0].DSED_RUTYPE = 0;
			}
		}
	});
	group.addView(rdoXtzby1);
	group.addView(rdoXtzby2);
	group.addView(rdoXtzby3);

	var chkXtfby1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
		if(paramList[0].DSED_RDTYPE == 0){
			chkXtfby1Checked = false;
		}
	}
	var chkXtfby1 = JyyCheckBox.init(null, chkXtfby1Checked, "1", "系统负备用", {top:"75px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_RDTYPE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_RDTYPE = 0;
		}
	});
	
	group.addView(chkXtfby1);
	
	var txtXtfby1Checked = 0.02;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RD)){
		txtXtfby1Checked = paramList[0].DSED_RD;
	}
	var txtXtfby1 = RxText.init(null, txtXtfby1Checked, "", {top:"75px",left:"160px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RD = param.value;
		}
	});
	group.addView(txtXtfby1);

	var rdoXtfby1Checked = true;
	var rdoXtfby2Checked = false;
	var rdoXtfby3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RDTYPE == 2){
			rdoXtfby1Checked = false;
			rdoXtfby2Checked = true;
			rdoXtfby3Checked = false;
		}else if(paramList[0].DSED_RDTYPE == 3){
			rdoXtfby1Checked = false;
			rdoXtfby2Checked = false;
			rdoXtfby3Checked = true;
		}
	}
	var rdoXtfby1 = JyyRadio.init(null, "t1g3", rdoXtfby1Checked,  "1", "全系统留取", {top:"105px",left:"20px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
			if(paramList[0].DSED_RDTYPE != 0){
				paramList[0].DSED_RDTYPE = 1;
			}else{
				paramList[0].DSED_RDTYPE = 0;
			}
		}
	});
	var rdoXtfby2 = JyyRadio.init(null, "t1g3", rdoXtfby2Checked, "2", "按区域留取", {top:"105px",left:"160px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
			if(paramList[0].DSED_RDTYPE != 0){
				paramList[0].DSED_RDTYPE = 2;
			}else{
				paramList[0].DSED_RDTYPE = 0;
			}
		}
	});
	var rdoXtfby3 = JyyRadio.init(null, "t1g3", rdoXtfby3Checked, "3", "按机组留取", {top:"105px",left:"300px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
			if(paramList[0].DSED_RDTYPE != 0){
				paramList[0].DSED_RDTYPE = 3;
			}else{
				paramList[0].DSED_RDTYPE = 0;
			}
		}
	});
	group.addView(rdoXtfby1);
	group.addView(rdoXtfby2);
	group.addView(rdoXtfby3);

	group.addView(RxLabel.init(null, "系统停机备用", {top:"135px",left:"20px",width:"140px",textAlign:"left"}));
	
	var txtXttjby1Checked = 0.05;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RSTATIC)){
		txtXttjby1Checked = paramList[0].DSED_RSTATIC;
	}
		var txtXttjby1 = RxText.init(null, txtXttjby1Checked, "", {top:"135px",left:"160px",width:"80px"},function(param){
			if(param.name == "onchange"){
				paramList[0].DSED_RSTATIC = param.value;
			}
		});
	group.addView(txtXttjby1);
	//未找到对应字段
	var chkXttjby1 = JyyCheckBox.init(null, false, "1", "为新能源预留备用", {top:"135px",left:"300px",width:"160px"}, function(param){
		console.log(param);
	});
	group.addView(chkXttjby1);

	group = createGroup("可选约束", 395, 20, 580, 65);
	panel.appendChild(group);

	var chkScxx1Checeked = true;
	var chkScxx2Checeked = true;
	var chkScxx3Checeked = false;
	var chkScxx4Checeked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BLINEFLOW)){
		if(paramList[0].DSED_BLINEFLOW == 0){
			chkScxx1Checeked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BSECTIONFLOW)){
		if(paramList[0].DSED_BSECTIONFLOW == 0){
			chkScxx2Checeked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BNODELOAD)){
		if(paramList[0].DSED_BNODELOAD == 1){
			chkScxx3Checeked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BMARGINALPRICE)){
		if(paramList[0].DSED_BMARGINALPRICE == 1){
			chkScxx4Checeked = true;
		}
	}
	var chkScxx1 = JyyCheckBox.init(null, chkScxx1Checeked, "1", "输出断面潮流", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BLINEFLOW = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BLINEFLOW = 0;
		}
	});
	var chkScxx2 = JyyCheckBox.init(null, chkScxx2Checeked, "1", "输出线路潮流", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BSECTIONFLOW = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BSECTIONFLOW = 0;
		}
	});
	var chkScxx3 = JyyCheckBox.init(null, chkScxx3Checeked, "1", "输出节点负荷", {top:"15px",left:"300px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BNODELOAD = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BNODELOAD = 0;
		}
	});
	var chkScxx4 = JyyCheckBox.init(null, chkScxx4Checeked, "1", "输出边际成本", {top:"15px",left:"440px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BMARGINALPRICE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BMARGINALPRICE = 0;
		}
	});
	group.addView(chkScxx1);
	group.addView(chkScxx2);
	group.addView(chkScxx3);
	group.addView(chkScxx4);
}

function createDyxx() {
	var group = createGroup("水电运行方式", 10, 20, 310, 125);
	panel.appendChild(group);
	
	var chkSdyx1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROLTHS)){
		if(paramList[0].DSED_HYDROLTHS == 1){
			chkSdyx1Checked = false;
		}
	}
	var chkSdyx1 = JyyCheckBox.init(null, chkSdyx1Checked, "0", "考虑中长期水电模拟", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_HYDROLTHS = 0;
		}else if(param.checked == false){
			paramList[0].DSED_HYDROLTHS = 1;
		}
	});
	group.addView(chkSdyx1);
	
	var rdoSdyx11Checked = true;
	var rdoSdyx12Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROSTYLE)){
		if(paramList[0].DSED_HYDROSTYLE == 1){
			rdoSdyx11Checked = false;
			rdoSdyx12Checked = true;
		}
	}
	var rdoSdyx11 = JyyRadio.init(null, "t2g1", rdoSdyx11Checked,  "0", "电量约束", {top:"45px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROSTYLE = 0;
	});
	var rdoSdyx12 = JyyRadio.init(null, "t2g1", rdoSdyx12Checked, "1", "水量约束", {top:"45px",left:"120px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROSTYLE = 1;
	});
	group.addView(rdoSdyx11);
	group.addView(rdoSdyx12);

	var rdoSdyx21Checked = false;
	var rdoSdyx22Checked = true;
	var rdoSdyx23Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROYEAR)){
		if(paramList[0].DSED_HYDROYEAR == 1){
			rdoSdyx21Checked = true;
			rdoSdyx22Checked = false;
			rdoSdyx23Checked = false;
		}else if(paramList[0].DSED_HYDROYEAR == 3){
			rdoSdyx21Checked = false;
			rdoSdyx22Checked = false;
			rdoSdyx23Checked = true;
		}
	}
	var rdoSdyx21 = JyyRadio.init(null, "t2g2", rdoSdyx21Checked,  "1", "枯水年", {top:"75px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 1;
	});
	var rdoSdyx22 = JyyRadio.init(null, "t2g2", rdoSdyx22Checked, "2", "平水年", {top:"75px",left:"120px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 2;
	});
	var rdoSdyx23 = JyyRadio.init(null, "t2g2", rdoSdyx23Checked, "3", "丰水年", {top:"75px",left:"220px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 3;
	});
	group.addView(rdoSdyx21);
	group.addView(rdoSdyx22);
	group.addView(rdoSdyx23);

	group = createGroup("核电选项", 145, 20, 310, 95);
	panel.appendChild(group);
	
	var rdoHdxx31Checked = true;
	var rdoHdxx32Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARSTYLE)){
		if(paramList[0].DSED_NUCLEARSTYLE == 1){
			rdoHdxx31Checked = false;
			rdoHdxx32Checked = true;
		}
	}
	var rdoHdxx31 = JyyRadio.init(null, "t2g3", rdoHdxx31Checked,  "0", "按额定容量运行", {top:"15px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_NUCLEARSTYLE = 0;
	});
	var rdoHdxx32 = JyyRadio.init(null, "t2g3", rdoHdxx32Checked, "1", "调峰容量不足时考虑降出力运行", {top:"45px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_NUCLEARSTYLE = 1;
	});
	group.addView(rdoHdxx31);
	group.addView(rdoHdxx32);

	group = createGroup("弃风/光与弃水选项", 250, 20, 310, 125, 135);
	panel.appendChild(group);
	
	var chkQfgs41Checked = true;
	var chkQfgs42Checked = false;
	var rdoQfgs41Checked = true;
	var rdoQfgs42Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILWINDPVORDER) && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILHYDROORDER)){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			chkQfgs41Checked = true;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			chkQfgs41Checked = true;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = false;
			rdoQfgs42Checked = true;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			chkQfgs41Checked = true;
			chkQfgs42Checked = false;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			chkQfgs41Checked = false;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = false;
			rdoQfgs42Checked = true;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			chkQfgs41Checked = false;
			chkQfgs42Checked = false;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}
	}
	var chkQfgs41 = JyyCheckBox.init(null, chkQfgs41Checked, "1", "允许弃风/光", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			rdoQfgs41.checked = true;
			rdoQfgs42.checked = false;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}else if(param.checked == false){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			rdoQfgs41.checked = false;
			rdoQfgs42.checked = true;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}
	});
	var chkQfgs42 = JyyCheckBox.init(null, chkQfgs42Checked, "2", "允许弃水", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CURTAILHYDROORDER = 2;
			rdoQfgs41.checked = false;
			rdoQfgs42.checked = true;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}else if(param.checked == false){
			paramList[0].DSED_CURTAILHYDROORDER = -1;
			rdoQfgs41.checked = true;
			rdoQfgs42.checked = false;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}
	});
	group.addView(chkQfgs41);
	group.addView(chkQfgs42);
	var rdoQfgs41 = JyyRadio.init(null, "t2g4", rdoQfgs41Checked,  "0", "先弃风/光再弃水", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}
	});
	var rdoQfgs42 = JyyRadio.init(null, "t2g4", rdoQfgs42Checked, "0", "先弃水再弃风/光", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = 2;
			paramList[0].DSED_CURTAILHYDROORDER = 1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			paramList[0].DSED_CURTAILWINDPVORDER = 2;
			paramList[0].DSED_CURTAILHYDROORDER = 1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}
	});
	group.addView(rdoQfgs41);
	group.addView(rdoQfgs42);

	group = createGroup("抽蓄运行方式", 10, 350, 260, 125, 96);
	panel.appendChild(group);
	
	var rdoCxyx11Checked = false;
	var rdoCxyx12Checked = false;
	var rdoCxyx13Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PUMPSTYLE)){
		if(paramList[0].DSED_PUMPSTYLE == 0){
			rdoCxyx11Checked = true;
			rdoCxyx12Checked = false;
			rdoCxyx13Checked = false;
		}else if(paramList[0].DSED_PUMPSTYLE == 1){
			rdoCxyx11Checked = false;
			rdoCxyx12Checked = true;
			rdoCxyx13Checked = false;
		}else if(paramList[0].DSED_PUMPSTYLE == 2){
			rdoCxyx11Checked = false;
			rdoCxyx12Checked = false;
			rdoCxyx13Checked = true;
		}
	}
	var rdoCxyx11 = JyyRadio.init(null, "t2g5", rdoCxyx11Checked,  "0", "优先做备用", {top:"15px",left:"20px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE = 0;
	});
	var rdoCxyx12 = JyyRadio.init(null, "t2g5", rdoCxyx12Checked, "1", "优先抽水发电", {top:"15px",left:"140px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE = 1;
	});
	var rdoCxyx13 = JyyRadio.init(null, "t2g5", rdoCxyx13Checked,  "2", "优先安排处理", {top:"45px",left:"20px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE =2;
	});
	group.addView(rdoCxyx11);
	group.addView(rdoCxyx12);
	group.addView(rdoCxyx13);
	
	group.addView(RxLabel.init(null, "调优容量比例", {top:"75px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtCxyx1Checked = 50;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PUMPWEEKOPTRATIO)){
		txtCxyx1Checked = paramList[0].DSED_PUMPWEEKOPTRATIO*100;
	}
	var txtCxyx1 = RxText.init(null, txtCxyx1Checked, "", {top:"75px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PUMPWEEKOPTRATIO = param.value/100;
		}
	});
	group.addView(txtCxyx1);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"195px",width:"20px",textAlign:"left"}));

	group = createGroup("可再生能源运行方式", 145, 350, 260, 195,144);
	panel.appendChild(group);
	
	var rdoKzsny1Checked = true;
	var rdoKzsny2Checked = false;
	var rdoKzsny3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLESTYLE)){
		if(paramList[0].DSED_RENEWABLESTYLE == 0){
			rdoKzsny1Checked = true;
			rdoKzsny2Checked = false;
			rdoKzsny3Checked = false;
		}else if(paramList[0].DSED_RENEWABLESTYLE == 1){
			rdoKzsny1Checked = false;
			rdoKzsny2Checked = true;
			rdoKzsny3Checked = false;
		}else if(paramList[0].DSED_RENEWABLESTYLE == 2){
			rdoKzsny1Checked = false;
			rdoKzsny2Checked = false;
			rdoKzsny3Checked = true;
		}
	}
	var rdoKzsny1 = JyyRadio.init(null, "t2g6", rdoKzsny1Checked,  "0", "随机模拟处理", {top:"15px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 0;
	});
	var rdoKzsny2 = JyyRadio.init(null, "t2g6", rdoKzsny2Checked, "1", "", {top:"50px",left:"20px",width:"30px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 1;
	});
	group.addView(RxLabel.init(null, "外部指定能力（未指定时段", {top:"39px",left:"40px",width:"240px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "分仍进行随机模拟）", {top:"59px",left:"40px",width:"240px",textAlign:"left"}));
	var rdoKzsny3 = JyyRadio.init(null, "t2g6", rdoKzsny3Checked, "2", "固定出力", {top:"85px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 2;
	});
	group.addView(rdoKzsny1);
	group.addView(rdoKzsny2);
	group.addView(rdoKzsny3);
	group.addView(RxLabel.init(null, "峰时段出力", {top:"110px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtKzsny1Checked = 0;
	
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLEPEAKOUTPUT)){
		txtKzsny1Checked = paramList[0].DSED_RENEWABLEPEAKOUTPUT*100;
	}
	var txtKzsny1 = RxText.init(null, txtKzsny1Checked, "", {top:"110px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RENEWABLEPEAKOUTPUT = param.value/100;
		}
	});
	group.addView(txtKzsny1);
	group.addView(RxLabel.init(null, "%", {top:"110px",left:"195px",width:"20px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "谷时段处理", {top:"140px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtKzsny2Checked = 50;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_DRENEWABLEVALLEYOUTPUT)){
		txtKzsny2Checked = paramList[0].DSED_DRENEWABLEVALLEYOUTPUT*100;
	}
	var txtKzsny2 = RxText.init(null, txtKzsny2Checked, "", {top:"140px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_DRENEWABLEVALLEYOUTPUT = param.value/100;
		}
	});
	group.addView(txtKzsny2);
	group.addView(RxLabel.init(null, "%", {top:"140px",left:"195px",width:"20px",textAlign:"left"}));

	group = createGroup("储能运行方式", 350, 350, 260, 100, 96);
	panel.appendChild(group);
	
	var chkCnyx1Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BBATTERYWEEK)){
		if(paramList[0].DSED_BBATTERYWEEK == 1){
			chkCnyx1Checked = true;
		}
	}
	var chkCnyx1 = JyyCheckBox.init(null, chkCnyx1Checked, "1", "考虑储能优化", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BBATTERYWEEK = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BBATTERYWEEK = 0;
		}
	});
	group.addView(chkCnyx1);
	group.addView(RxLabel.init(null, "调优容量比例", {top:"45px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtCnyx1Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BATTERYWEEKOPTRATIO)){
		txtCnyx1Checked = paramList[0].DSED_BATTERYWEEKOPTRATIO*100;
	}
	var txtCnyx1 = RxText.init(null, txtCnyx1Checked, "", {top:"45px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_BATTERYWEEKOPTRATIO = param.value/100;
		}
	});
	group.addView(txtCnyx1);
	group.addView(RxLabel.init(null, "%", {top:"45px",left:"195px",width:"20px",textAlign:"left"}));

}

function createTfxx() {
	var chkTfxx1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_IGNORERESERVE)){
		if(paramList[0].DSED_IGNORERESERVE == 0){
			chkTfxx1Checked = false;
		}
	}
	var chkTfxx1 = JyyCheckBox.init(null, chkTfxx1Checked, "1", "调峰或备用不足时去除备用", {top:"15px",left:"20px",width:"240px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_IGNORERESERVE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_IGNORERESERVE = 0;
		}
	});
	panel.appendChild(chkTfxx1);
	panel.appendChild(RxLabel.init(null, "当地谷符合小于高峰负荷", {top:"45px",left:"20px",width:"180px",textAlign:"left"}));
	
	var txtCxyx1Checked = 70;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_DEEPREGULATIONLMT)){
		txtCxyx1Checked = (paramList[0].DSED_DEEPREGULATIONLMT*100).toFixed(2);
	}
		var txtCxyx1 = RxText.init(null, txtCxyx1Checked, "", {top:"45px",left:"200px",width:"50px"},function(param){
			if(param.name == "onchange"){
				paramList[0].DSED_DEEPREGULATIONLMT = param.value/100;
			}
		});
	panel.appendChild(txtCxyx1);
	panel.appendChild(RxLabel.init(null, "%时，启用如下深度调峰选项", {top:"45px",left:"255px",width:"220px",textAlign:"left"}));

	var group = createGroup("深度调峰选项", 75, 20, 525, 285, 96);
	panel.appendChild(group);
	
	var chkSdtf01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == -1){
			chkSdtf01Checked = false;
		}
	}
	var chkSdtf01 = JyyCheckBox.init(null, chkSdtf01Checked, "0", "燃机启停调峰", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GTSTOPORDER = 1;
			lstSdtf01.checkNode(1, true);
		}else if(param.checked == false){
			paramList[0].DSED_GTSTOPORDER = -1;
		}
	});
	group.addView(chkSdtf01);
	group.addView(RxLabel.init(null, "置燃机最小开机时间", {top:"45px",left:"20px",width:"160px",textAlign:"left"}));
	
	var txtSdtf01Checked = 6;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTMINONTIME)){
		txtSdtf01Checked = paramList[0].DSED_GTMINONTIME;
	}
	var txtSdtf01 = RxText.init(null, txtSdtf01Checked, "", {top:"45px",left:"168px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_GTMINONTIME = param.value;
		}
	});
	group.addView(txtSdtf01);
	group.addView(RxLabel.init(null, "小时", {top:"45px",left:"255px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"45px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf01 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_GTMINONTIME = data.node.data.code;
	});
	var drpSdtf01 = RxDropList.init(null, "", {list:lstSdtf01}, {position:'absolute', left:'440px', top:'45px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf01);
	var lstSdtf01Checked = 1;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == 2){
			lstSdtf01Checked = 2;
		}else if(paramList[0].DSED_GTSTOPORDER == 3){
			lstSdtf01Checked = 3;
		}else if(paramList[0].DSED_GTSTOPORDER == 4){
			lstSdtf01Checked = 4;
		}
	}
	lstSdtf01.checkNode(lstSdtf01Checked, true);

	var chkSdtf02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER == -1){
			chkSdtf02Checked = false;
		}
	}
	var chkSdtf02 = JyyCheckBox.init(null, chkSdtf02Checked, "0", "火电出力深度调峰", {top:"75px",left:"20px",width:"160px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_THERMALDEEPORDER = 2;
			lstSdtf02.checkNode(2, true);
		}else if(param.checked == false){
			paramList[0].DSED_THERMALDEEPORDER = -1;
		}
	});
	group.addView(chkSdtf02);
	group.addView(RxLabel.init(null, "火电机组最小负荷率", {top:"105px",left:"20px",width:"160px",textAlign:"left"}));
	
	var txtSdtf02Checked = 30;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALMINLOAD)){
		txtSdtf02Checked = paramList[0].DSED_THERMALMINLOAD*100;
	}
	var txtSdtf02 = RxText.init(null, txtSdtf02Checked, "", {top:"105px",left:"168px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_THERMALMINLOAD = param.value/100;
		}
	});
	group.addView(txtSdtf02);
	group.addView(RxLabel.init(null, "%", {top:"105px",left:"255px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"105px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf02 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_THERMALDEEPORDER = data.node.data.code;
	});
	var drpSdtf02 = RxDropList.init(null, "", {list:lstSdtf02}, {position:'absolute', left:'440px', top:'105px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf02);
	var lstSdtf02Checked = 2;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER == 1){
			lstSdtf02Checked = 1;
		}else if(paramList[0].DSED_THERMALDEEPORDER == 3){
			lstSdtf02Checked = 3;
		}else if(paramList[0].DSED_THERMALDEEPORDER == 4){
			lstSdtf02Checked = 4;
		}
	}
	lstSdtf02.checkNode(lstSdtf02Checked, true);

	var chkSdtf03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER == -1){
			chkSdtf03Checked = false;
		}
	}
	var chkSdtf03 = JyyCheckBox.init(null, chkSdtf03Checked, "0", "火电启停调峰", {top:"135px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_THERMALSTOPORDER = 3;
			lstSdtf03.checkNode(3, true);
		}else if(param.checked == false){
			paramList[0].DSED_THERMALSTOPORDER = -1;
		}
	});
	group.addView(chkSdtf03);
	group.addView(RxLabel.init(null, "机组容量不大于", {top:"165px",left:"20px",width:"120px",textAlign:"left"}));
	var txtSdtf03Checked = 300;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALCAPLMT)){
		txtSdtf03Checked = paramList[0].DSED_THERMALCAPLMT;
	}
	var txtSdtf03 = RxText.init(null, txtSdtf03Checked, "", {top:"165px",left:"138px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_THERMALCAPLMT = param.value;
		}
	});
	group.addView(txtSdtf03);
	group.addView(RxLabel.init(null, "MW参与启停", {top:"165px",left:"225px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"165px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf03 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_THERMALSTOPORDER = data.node.data.code;
	});
	var drpSdtf03 = RxDropList.init(null, "", {list:lstSdtf03}, {position:'absolute', left:'440px', top:'165px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf03);
	var lstSdtf03Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER == 1){
			lstSdtf03Checked = 1;
		}else if(paramList[0].DSED_THERMALSTOPORDER == 2){
			lstSdtf03Checked = 2;
		}else if(paramList[0].DSED_THERMALSTOPORDER == 4){
			lstSdtf03Checked = 4;
		}
	}
	lstSdtf03.checkNode(lstSdtf03Checked, true);

	var chkSdtf04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == -1){
			chkSdtf04Checked = false;
		}
	}
	var chkSdtf04 = JyyCheckBox.init(null, chkSdtf04Checked, "0", "核电机组出力深度调峰", {top:"225px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_NUCLEARDEEPORDER = 4;
			lstSdtf04.checkNode(4, true);
		}else if(param.checked == false){
			paramList[0].DSED_NUCLEARDEEPORDER = -1;
		}
	});
	
	group.addView(chkSdtf04);
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"225px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf04 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_NUCLEARDEEPORDER = data.node.data.code;
	});
	var drpSdtf04 = RxDropList.init(null, "", {list:lstSdtf04}, {position:'absolute', left:'440px', top:'225px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf04);
	var lstSdtf04Checked = 4;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == 1){
			lstSdtf04Checked = 1;
		}else if(paramList[0].DSED_NUCLEARDEEPORDER == 2){
			lstSdtf04Checked = 2;
		}else if(paramList[0].DSED_NUCLEARDEEPORDER == 3){
			lstSdtf04Checked = 3;
		}
	}
	lstSdtf04.checkNode(lstSdtf04Checked, true);
}

function createJxxx() {
	var group = createGroup("机组检修", 10, 20, 580, 190);
	panel.appendChild(group);

	var rdoJxxx01Checked = false;
	var rdoJxxx02Checked = true;
	var rdoJxxx03Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx01Checked = true;
			rdoJxxx02Checked = false;
			rdoJxxx03Checked = false;
		}else if(paramList[0].DSED_RUNUMT == 2){
			rdoJxxx01Checked = false;
			rdoJxxx02Checked = false;
			rdoJxxx03Checked = true;
		}
	}
	var rdoJxxx01 = JyyRadio.init(null, "t5g1", rdoJxxx01Checked,  "0", "不考虑检修", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 0;
		rdoJxxx11.disable(true);
		rdoJxxx12.disable(true);
		rdoJxxx13.disable(true);
		rdoJxxx21.disable(true);
		rdoJxxx22.disable(true);
	});
	var rdoJxxx02 = JyyRadio.init(null, "t5g1", rdoJxxx02Checked, "1", "全局优化检修", {top:"15px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 1;
		rdoJxxx11.disable(false);
		rdoJxxx12.disable(false);
		rdoJxxx13.disable(false);
		rdoJxxx21.disable(false);
		rdoJxxx22.disable(false);
	});
	var rdoJxxx03 = JyyRadio.init(null, "t5g1", rdoJxxx03Checked, "2", "启发式优化检修", {top:"15px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 2;
		rdoJxxx11.disable(false);
		rdoJxxx12.disable(false);
		rdoJxxx13.disable(false);
		rdoJxxx21.disable(false);
		rdoJxxx22.disable(false);
	});
	group.addView(rdoJxxx01);
	group.addView(rdoJxxx02);
	group.addView(rdoJxxx03);

	group.addView(RxLabel.init(null, "检修目标：", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));
	
	var rdoJxxx11Checked = true;
	var rdoJxxx12Checked = false;
	var rdoJxxx13Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_UMTMETHOD)){
		if(paramList[0].DSED_UMTMETHOD == 1){
			rdoJxxx11Checked = false;
			rdoJxxx12Checked = true;
			rdoJxxx13Checked = false;
		}else if(paramList[0].DSED_UMTMETHOD == 2){
			rdoJxxx11Checked = false;
			rdoJxxx12Checked = false;
			rdoJxxx13Checked = true;
		}
	}
	var rdoJxxx11 = JyyRadio.init(null, "t5g2", rdoJxxx11Checked,  "0", "等备用", {top:"75px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 0;
	});
	var rdoJxxx12 = JyyRadio.init(null, "t5g2", rdoJxxx12Checked, "1", "等备用率", {top:"75px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 1;
	});
	var rdoJxxx13 = JyyRadio.init(null, "t5g2", rdoJxxx13Checked, "2", "等风险度", {top:"75px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 2;
	});
	rdoJxxx11.disable(false);
	rdoJxxx12.disable(false);
	rdoJxxx13.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx11.disable(true);
			rdoJxxx12.disable(true);
			rdoJxxx13.disable(true);
		}
	}
	group.addView(rdoJxxx11);
	group.addView(rdoJxxx12);
	group.addView(rdoJxxx13);

	group.addView(RxLabel.init(null, "检修方式：", {top:"105px",left:"20px",width:"100px",textAlign:"left"}));
	
	var rdoJxxx21Checked = true;
	var rdoJxxx22Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_UMTMEAN)){
		if(paramList[0].DSED_UMTMEAN == 1){
			rdoJxxx21Checked = false;
			rdoJxxx22Checked = true;
		}
	}
	var rdoJxxx21 = JyyRadio.init(null, "t5g3", rdoJxxx21Checked,  "0", "按等效检修天数安排", {top:"135px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMEAN = 0;
	});
	var rdoJxxx22 = JyyRadio.init(null, "t5g3", rdoJxxx22Checked, "1", "考虑机组大小修", {top:"135px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMEAN = 1;
	});
	rdoJxxx21.disable(false);
	rdoJxxx22.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx21.disable(true);
			rdoJxxx22.disable(true);
		}
	}
	group.addView(rdoJxxx21);
	group.addView(rdoJxxx22);

	group = createGroup("线路检修", 210, 20, 580, 68);
	panel.appendChild(group);
	//未找到对应字段
	var chkJxxx01 = JyyCheckBox.init(null, false, "0", "考虑线路检修", {top:"15px",left:"20px",width:"140px"}, function(param){
		console.log(param);
	});
	group.addView(chkJxxx01);
}
function createSdyxxx() {
	var group = createGroup("水电运行方式", 10, 20, 580, 130, 96);
	panel.appendChild(group);
	
	var chkSdyx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRCOR)){
		if(paramList[0].LTHS_RESERVOIRCOR == 0){
			chkSdyx01Checked = false;
		}
	}
	var chkSdyx01 = JyyCheckBox.init(null, chkSdyx01Checked, "1", "考虑梯级电站协调", {top:"15px",left:"20px",width:"180px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIRCOR = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIRCOR = 0;
		}
	});
	group.addView(chkSdyx01);
	
	var chkSdyx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDROLIMIT)){
		if(paramList[0].LTHS_HYDROLIMIT == 0){
			chkSdyx02Checked = false;
		}
	}
	var chkSdyx02 = JyyCheckBox.init(null, chkSdyx02Checked, "1", "是否考虑跨流域之间协调", {top:"15px",left:"220px",width:"220px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_HYDROLIMIT = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_HYDROLIMIT = 0;
		}
	});
	group.addView(chkSdyx02);
	
	var chkSdyx03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_WATERMAX)){
		if(paramList[0].LTHS_WATERMAX == 0){
			chkSdyx03Checked = false;
		}
	}
	var chkSdyx03 = JyyCheckBox.init(null, chkSdyx03Checked, "1", "考虑水库最大用水量", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_WATERMAX = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_WATERMAX = 0;
		}
	});
	group.addView(chkSdyx03);
	group.addView(RxLabel.init(null, "出力总和最大出力", {top:"45px",left:"220px",width:"140px",textAlign:"left"}));
	
	var txtSdyx01Checked = 100;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_LIMITHIGH)){
		txtSdyx01Checked = paramList[0].LTHS_LIMITHIGH*100;
	}
	var txtSdyx01 = RxText.init(null, txtSdyx01Checked, "", {top:"45px",left:"353px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_LIMITHIGH = param.value/100;
		}
	});
	group.addView(txtSdyx01);
	group.addView(RxLabel.init(null, "%　总负荷", {top:"45px",left:"440px",width:"80px",textAlign:"left"}));
	
	var chkSdyx04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIREVAPO)){
		if(paramList[0].LTHS_RESERVOIREVAPO == 0){
			chkSdyx04Checked = false;
		}
	}
	var chkSdyx04 = JyyCheckBox.init(null, chkSdyx04Checked, "0", "考虑水库蒸发", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIREVAPO = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIREVAPO = 0;
		}
	});
	group.addView(chkSdyx04);
	group.addView(RxLabel.init(null, "出力总和最小出力", {top:"75px",left:"220px",width:"140px",textAlign:"left"}));
	
	var txtSdyx02Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_LIMITLOW)){
		txtSdyx02Checked = paramList[0].LTHS_LIMITLOW*100;
	}
	var txtSdyx02 = RxText.init(null, txtSdyx02Checked, "", {top:"75px",left:"353px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_LIMITLOW = param.value/100;
		}
	});
	group.addView(txtSdyx02);
	group.addView(RxLabel.init(null, "%　总负荷", {top:"75px",left:"440px",width:"80px",textAlign:"left"}));

	group = createGroup("水电优化目标", 150, 20, 580, 65, 96);
	panel.appendChild(group);
	
	var rdoSdyx01Checked = true;
	var rdoSdyx02Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_GOALSTYLE)){
		if(paramList[0].LTHS_GOALSTYLE == 1){
			rdoSdyx01Checked = false;
			rdoSdyx02Checked = true;
		}
	}
	var rdoSdyx01 = JyyRadio.init(null, "t6g1", rdoSdyx01Checked,  "0", "考虑水电调峰效益", {top:"15px",left:"20px",width:"160px"}, function(param){
		paramList[0].LTHS_GOALSTYLE = 0;
	});
	var rdoSdyx02 = JyyRadio.init(null, "t6g1", rdoSdyx02Checked, "1", "水电发电量最大化", {top:"15px",left:"220px",width:"160px"}, function(param){
		paramList[0].LTHS_GOALSTYLE = 1;
	});
	group.addView(rdoSdyx01);
	group.addView(rdoSdyx02);

	group = createGroup("水电模拟选项", 225, 20, 580, 100, 96);
	panel.appendChild(group);
	
	var chkSdyx05Checked = true;
	var chkSdyx06Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM == 1){
			chkSdyx05Checked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM == 1){
			chkSdyx06Checked = false;
		}
	}
	var chkSdyx05 = JyyCheckBox.init(null, chkSdyx05Checked, "1", "是否考虑水电出力非线性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_HYDRODIVNUM = 3;
		}else if(param.checked == false){
			paramList[0].LTHS_HYDRODIVNUM = 1;
		}
	});
	group.addView(chkSdyx05);
	var chkSdyx06 = JyyCheckBox.init(null, chkSdyx06Checked, "1", "是否考虑水头非线性", {top:"15px",left:"220px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIRDIVNUM = 3;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIRDIVNUM = 1;
		}
	});
	group.addView(chkSdyx06);
	group.addView(RxLabel.init(null, "线性化", {top:"45px",left:"20px",width:"60px",textAlign:"left"}));
	
	var txtSdyx03Checked = 3;
	var txtSdyx04Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM != 1){
			txtSdyx03Checked = paramList[0].LTHS_HYDRODIVNUM;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM != 1){
			txtSdyx04Checked = paramList[0].LTHS_RESERVOIRDIVNUM;
		}
	}
	var txtSdyx03 = RxText.init(null, txtSdyx03Checked, "", {top:"45px",left:"75px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_HYDRODIVNUM = param.value;
		}
	});
	group.addView(txtSdyx03);
	group.addView(RxLabel.init(null, "段", {top:"45px",left:"163px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "线性化", {top:"45px",left:"220px",width:"60px",textAlign:"left"}));
	var txtSdyx04 = RxText.init(null, txtSdyx04Checked, "", {top:"45px",left:"275px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_RESERVOIRDIVNUM = param.value;
		}
	});
	group.addView(txtSdyx04);
	group.addView(RxLabel.init(null, "段", {top:"45px",left:"363px",width:"80px",textAlign:"left"}));
}

function createXnyyxxx() {
	var group = createGroup("风电选项", 10, 20, 580, 255);
	panel.appendChild(group);

	var cggroup = createGroup("常规选项", 25, 20, 240, 210);
	group.appendChild(cggroup);
	
	var chkFdxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_WINDCORR)){
		if(paramList[0].WPOS_WINDCORR == 0){
			chkFdxx01Checked = false;
		}
	}
	var chkFdxx01 = JyyCheckBox.init(null, chkFdxx01Checked, "1", "考虑风电场空间相关性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_WINDCORR = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_WINDCORR = 0;
		}
	});
	cggroup.addView(chkFdxx01);
	
	var chkFdxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RELIABILITY)){
		if(paramList[0].WPOS_RELIABILITY == 0){
			chkFdxx02Checked = false;
		}
	}
	var chkFdxx02 = JyyCheckBox.init(null, chkFdxx02Checked, "1", "考虑风电机组可靠性", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_RELIABILITY = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_RELIABILITY = 0;
		}
	});
	cggroup.addView(chkFdxx02);
	
	var chkFdxx03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_WAKEEFFECT)){
		if(paramList[0].WPOS_WAKEEFFECT == 0){
			chkFdxx03Checked = false;
		}
	}
	var chkFdxx03 = JyyCheckBox.init(null, chkFdxx03Checked, "1", "考虑风电场尾流效应", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_WAKEEFFECT = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_WAKEEFFECT = 0;
		}
	});
	cggroup.addView(chkFdxx03);
	
	var chkFdxx04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_DAYRHYTHM)){
		if(paramList[0].WPOS_DAYRHYTHM == 0){
			chkFdxx04Checked = false;
		}
	}
	var chkFdxx04 = JyyCheckBox.init(null, chkFdxx04Checked, "1", "考虑风速日特性", {top:"105px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_DAYRHYTHM = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_DAYRHYTHM = 0;
		}
	});
	cggroup.addView(chkFdxx04);
	
	var chkFdxx05Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_SEASONRHYTHM)){
		if(paramList[0].WPOS_SEASONRHYTHM == 0){
			chkFdxx05Checked = false;
		}
	}
	var chkFdxx05 = JyyCheckBox.init(null, chkFdxx05Checked, "1", "考虑风速季节特性", {top:"135px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_SEASONRHYTHM = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_SEASONRHYTHM = 0;
		}
	});
	cggroup.addView(chkFdxx05);

	var msgroup = createGroup("风机功率特性曲线模式", 25, 280, 240, 100, 160);
	group.appendChild(msgroup);
	
	var rdoFdxx01Checked = false;
	var rdoFdxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_POWERCURVE)){
		if(paramList[0].WPOS_POWERCURVE == 0){
			rdoFdxx01Checked = true;
			rdoFdxx02Checked = false;
		}
	}
	var rdoFdxx01 = JyyRadio.init(null, "t7g1", rdoFdxx01Checked,  "0", "直线型", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_POWERCURVE = 0;
	});
	msgroup.addView(rdoFdxx01);
	var rdoFdxx02 = JyyRadio.init(null, "t7g1", rdoFdxx02Checked, "1", "三次曲线型", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_POWERCURVE = 1;
	});
	msgroup.addView(rdoFdxx02);

	var sjgroup = createGroup("随机数选项", 135, 280, 240, 100, 82);
	group.appendChild(sjgroup);
	
	var rdoFdxx11Checked = false;
	var rdoFdxx12Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			rdoFdxx11Checked = true;
			rdoFdxx12Checked = false;
		}
	}
	var rdoFdxx11 = JyyRadio.init(null, "t7g2", rdoFdxx11Checked,  "0", "随机种子", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_RAMDOMTYPE = 0;
		txtFdxx01.setReadOnly(true);
		rdoFdxx12.label.style.color = '#c6c6c6';
	});
	sjgroup.addView(rdoFdxx11);
	var rdoFdxx12 = JyyRadio.init(null, "t7g2", rdoFdxx12Checked, "1", "固定种子：", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_RAMDOMTYPE = 1;
		txtFdxx01.setReadOnly(false);
		rdoFdxx12.label.style.color = '#666666';
	});
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			rdoFdxx12.label.style.color = '#c6c6c6';
		}
	}
	sjgroup.addView(rdoFdxx12);
	
	var txtFdxx01Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMSEED)){
		txtFdxx01Checked = paramList[0].WPOS_RAMDOMSEED;
	}
	var txtFdxx01 = RxText.init(null, txtFdxx01Checked, "", {top:"45px",left:"120px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].WPOS_RAMDOMSEED = param.value;
		}
	});
	txtFdxx01.setReadOnly(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			txtFdxx01.setReadOnly(true);
		}
	}
	sjgroup.addView(txtFdxx01);

	group = createGroup("光伏选项", 275, 20, 580, 145);
	panel.appendChild(group);

	cggroup = createGroup("常规选项", 25, 20, 240, 100);
	group.appendChild(cggroup);
	
	var chkGfxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_PVCORR)){
		if(paramList[0].PVOS_PVCORR == 0){
			chkGfxx01Checked = false;
		}
	}
	var chkGfxx01 = JyyCheckBox.init(null, chkGfxx01Checked, "1", "考虑风电场空间相关性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].PVOS_PVCORR = 1;
		}else if(param.checked == false){
			paramList[0].PVOS_PVCORR = 0;
		}
	});
	cggroup.addView(chkGfxx01);
	
	var chkGfxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RELIABILITY)){
		if(paramList[0].PVOS_RELIABILITY == 0){
			chkGfxx02Checked = false;
		}
	}
	var chkGfxx02 = JyyCheckBox.init(null, chkGfxx02Checked, "1", "考虑风电机组可靠性", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].PVOS_RELIABILITY = 1;
		}else if(param.checked == false){
			paramList[0].PVOS_RELIABILITY = 0;
		}
	});
	cggroup.addView(chkGfxx02);

	sjgroup = createGroup("随机数选项", 25, 280, 240, 100, 82);
	group.appendChild(sjgroup);
	
	var rdoGfxx11Checked = false;
	var rdoGfxx12Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			rdoGfxx11Checked = true;
			rdoGfxx12Checked = false;
		}
	}
	var rdoGfxx11 = JyyRadio.init(null, "t7g3", rdoGfxx11Checked,  "0", "随机种子", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].PVOS_RAMDOMTYPE = 0;
		txtGfxx01.setReadOnly(true);
		rdoGfxx12.label.style.color = '#c6c6c6';
	});
	sjgroup.addView(rdoGfxx11);
	var rdoGfxx12 = JyyRadio.init(null, "t7g3", rdoGfxx12Checked, "1", "固定种子：", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].PVOS_RAMDOMTYPE = 1;
		txtGfxx01.setReadOnly(false);
		rdoGfxx12.label.style.color = '#666666';
	});
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			rdoGfxx12.label.style.color = '#c6c6c6';
		}
	}
	sjgroup.addView(rdoGfxx12);
	
	var txtGfxx01Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMSEED)){
		txtGfxx01Checked = paramList[0].PVOS_RAMDOMSEED;
	}
	var txtGfxx01 = RxText.init(null, txtGfxx01Checked, "", {top:"45px",left:"120px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].PVOS_RAMDOMSEED = param.value;
		}
	});
	txtGfxx01.setReadOnly(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			txtGfxx01.setReadOnly(true);
		}
	}
	sjgroup.addView(txtGfxx01);
}

function createYhxx() {
	var group = createGroup("程序诊断选项", 10, 20, 300, 100, 96);
	panel.appendChild(group);
	
	var chkYhxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CONSOLE)){
		if(paramList[0].DSED_CONSOLE == 0){
			chkYhxx01Checked = false;
		}
	}
	var chkYhxx01 = JyyCheckBox.init(null, chkYhxx01Checked, "1", "显示控制台", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CONSOLE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_CONSOLE = 0;
		}
	});
	group.addView(chkYhxx01);
	group.addView(RxLabel.init(null, "控制台调试信息等级", {top:"45px",left:"40px",width:"150px",textAlign:"left"}));
	var lstYhxx01 = RxTree.init(null, [{code:0,name:0},{code:1,name:1},{code:2,name:2},{code:3,name:3}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_MSGLEV = data.node.data.code;
	});
	var drpYhxx01 = RxDropList.init(null, "", {list:lstYhxx01}, {position:'absolute', left:'190px', top:'45px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpYhxx01);
	
	var lstYhxx01Checked = 1;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MSGLEV)){
		if(paramList[0].DSED_MSGLEV == 0){
			lstYhxx01Checked = 0;
		}else if(paramList[0].DSED_MSGLEV == 2){
			lstYhxx01Checked = 2;
		}else if(paramList[0].DSED_MSGLEV == 3){
			lstYhxx01Checked = 3;
		}
	}
	lstYhxx01.checkNode(lstYhxx01Checked, true);
	group = createGroup("程序优化核心选项", 120, 20, 300, 130, 128);
	panel.appendChild(group);
	group.addView(RxLabel.init(null, "计算时间限制", {top:"15px",left:"20px",width:"100px",textAlign:"left"}));
	
	var txtYhxx01Checked = 5;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_TIMEOUT)){
		txtYhxx01Checked = paramList[0].DSED_TIMEOUT;
	}
	var txtYhxx01 = RxText.init(null, txtYhxx01Checked, "", {top:"15px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_TIMEOUT = param.value;
		}
	});
	group.addView(txtYhxx01);
	group.addView(RxLabel.init(null, "秒", {top:"15px",left:"230px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "最大迭代次数", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx02Checked = 3000;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MAXITERATIONS)){
		txtYhxx02Checked = paramList[0].DSED_MAXITERATIONS;
	}
	var txtYhxx02 = RxText.init(null, txtYhxx02Checked, "", {top:"45px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_MAXITERATIONS = param.value;
		}
	});
	group.addView(txtYhxx02);
	group.addView(RxLabel.init(null, "次", {top:"45px",left:"230px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "优化计算间隙", {top:"75px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx03Checked = 0.01;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PRECISION)){
		txtYhxx03Checked = paramList[0].DSED_PRECISION;
	}
	var txtYhxx03 = RxText.init(null, txtYhxx03Checked, "", {top:"75px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PRECISION = param.value;
		}
	});
	group.addView(txtYhxx03);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"230px",width:"80px",textAlign:"left"}));
}

function createGroup(text, top, left, width, height, textWidth) {
	var ctrl = document.createElement("div");
	ctrl.className = "gopt_group";
	ctrl.style.top = top + "px";
	ctrl.style.left = left + "px";
	ctrl.style.width = width + "px";
	ctrl.style.height = height + "px";
	ctrl.panel = document.createElement("div");
	ctrl.panel.className = "gopt_group_panel";
	ctrl.appendChild(ctrl.panel);
	ctrl.text = document.createElement("div");
	ctrl.text.className = "gopt_group_text";
	ctrl.text.innerHTML = text;
	if (textWidth !== undefined) {
		ctrl.text.style.width = textWidth + "px";
	}
	ctrl.appendChild(ctrl.text);

	ctrl.addView = function(view) {
		ctrl.panel.appendChild(view);
	};

	return ctrl;
}

//模拟参数
var sps = {
	base:{//基本参数
		plan: [
			{
				id:0,
				name:"方案MMMMMM"
			}
		],
		etime: {//评估时间
			formDate:"2019-03-19",
			toDate:"2019-03-19"
		},
		scene: {//典型场景选择
			way:1,//0,1,2
			type:[1,1,1,1]
		}
	},
	run: {
	}
};
function resizeAddPlanPage() {
	var panel = $('#viewPanel')[0];
	var panelWidth = $('#viewPanel').width();
	var panelHeight = $('#viewPanel').height();
	$('#planPanel').css({top:((panelHeight-350)/2)+"px",left:((panelWidth-600)/2)+"px"});
}
function resizeRunPage() {
	var panel = $('#viewPanel')[0];
	var panelWidth = $('#viewPanel').width();
	var panelHeight = $('#viewPanel').height();
	$('#runPanel').css({top:((panelHeight-615)/2)+"px",left:((panelWidth-915)/2)+"px"});
	$('#runProcessPanel').css({top:((panelHeight-340)/2)+"px",left:((panelWidth-670)/2)+"px"});
}

function setChecked(obj, value){
	if(value == 1){
		obj.onclick();
	}
}

var timer = null;
var loopCount = 0;
function showProcessBar() {
	var n = 40;
	var arr =[];
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>【提示信息】模型求解...<br/>");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>【提示信息】模型求解...<br/>【提示信息】计算完成！");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>【提示信息】模型求解...<br/>【提示信息】计算完成！<br/>【提示信息】导入结果完成！");
	$('#progressDiv').show();
	loopCount = 0;
	timer = setInterval(function() {
		loopCount = loopCount + 1;
		var width = parseInt(loopCount*420/n);
		if (width > 420) {
			width = 420;
		}
		$('#runPanel').hide();
		$('#progressStrip').css({width:width});
    	$('#progressStrip').find("span").text(parseInt(width*100/420) +"%　");
		$('#progressText').html(arr[parseInt(width*100/420/20)-1]);
    	$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
    	$("#progressState").setStep(parseInt(width*100/420/20));
		
		if (loopCount > (n+6)) {
			hideProcessBar();
		}
	}, 500);
}
function hideProcessBar() {
	if (timer) {
		clearInterval(timer);
	}
	loopCount = 0;
	$('#progressStrip').css({width:"0%"});
	$('#progressStrip').find("span").text("0%");
	$('#progressText').html("");
	$("#progressState").setStep(0);
	$('#wizardMask').hide();
	$('#progressDiv').hide();
	onMenuClick(2);
}

function getParams(){
	$.ajax({
		async:false,
		url:"../pv/work/getParams",
		type:"POST",
		data:{"projectid":planId},
		success:function(res){
			paramList = res.result
		}
	});
}
function killNowTask(taskid){
	var method ='killNowTask';
	invoke(method, {modelId:modelId,taskid:taskid}, function(data){
    	}
	);
};
function getDaysBetween(startDate, enDate) {
  const sDate = Date.parse(startDate)
  const eDate = Date.parse(enDate)
  if (sDate > eDate) {
    return 0
  }
  if (sDate === eDate) {
    return 1
  }
  const days = (eDate - sDate) / (1 * 24 * 60 * 60 * 1000)
  return days+1
}
function invoke(url, args, callback){
	var r, op = {
			url: '../g/service/Sample/' + url,
			type:'POST',
			cache:false,
			async:true,
			dataType:'json',
			data:args ? JSON.stringify(args) : null,
			contentType:"application/json"
		};
	if(typeof callback == 'function'){
		op.success = function(data){
			if(data.error)return alert(data.error);
			callback(data);
		}
	} else {
		op.async = false;
		op.success = function(data){
			r = data
		};
	}
	$.ajax(op);
	if(r)if(r.error){
		alert(r.error);
		return null;
	}
	return r;
};
function invoke_sys(url, args, callback){
	var r, op = {
			url: '../g/service/Sysconfig/' + url,
			type:'POST',
			cache:false,
			async:true,
			dataType:'json',
			data:args ? JSON.stringify(args) : null,
			contentType:"application/json"
		};
	if(typeof callback == 'function'){
		op.success = function(data){
			if(data.error)return alert(data.error);
			callback(data);
		}
	} else {
		op.async = false;
		op.success = function(data){
			r = data
		};
	}
	$.ajax(op);
	if(r)if(r.error){
		alert(r.error);
		return null;
	}
	return r;
};